package com.baichuan.enums;

import com.baichuan.util.StringUtils;

/**
 * @Auther: leo
 * @Date: 2021/10/16 16:49
 * @Description: 通知类型枚举
 */
public enum NoticeTypeEnum {
    /**
     * 车辆审核不通过
     */
    carAuditNoPass("carAuditNoPass", "车辆审核不通过"),
    /**
     * 求购审核不通过
     */
    wantBuyAuditNoPass("wantBuyAuditNoPass", "求购审核不通过"),
    /**
     * 拍卖审核通过
     */
    auctionAuditPass("auctionAuditPass", "拍卖审核通过"),
    /**
     * 拍卖审核不通过
     */
    auctionAuditNoPass("auctionAuditNoPass", "拍卖审核不通过"),
    /**
     * 秒批审核不通过
     */
    secondBatchAuditNoPass("secondBatchAuditNoPass", "秒批审核不通过"),
    /**
     * 车辆出价
     */
    carOfferPrice("carOfferPrice", "车辆出价"),
    /**
     * 车商认证
     */
    dealerAuthOrder("dealerAuthOrder", "车商认证"),
    /**
     * 秒批审核不通过
     */
    dealerGoldMedalOrder("secondBatchAuditNoPass", "金牌车商"),
    /**
     * 交易保障金
     */
    dealerTransactionGuaranteeOrder("dealerTransactionGuaranteeOrder", "交易保障金"),
    /**
     * 真车认证审核不通过
     */
    authenticationAuditPass("authenticationAuditPass", "真车认证审通过"),
    /**
     * 真车认证审核不通过
     */
    authenticationAuditNoPass("authenticationAuditNoPass", "真车认证审核不通过");


    /**
     * 文件代码
     */
    private final String noticeType;

    /**
     * 文件前缀
     */
    private final String noticeTypeName;


    private NoticeTypeEnum(final String noticeType, final String noticeTypeName) {
        this.noticeType = noticeType;
        this.noticeTypeName = noticeTypeName;
    }

    public String getNoticeType() {
        return noticeType;
    }

    public String getNoticeTypeName() {
        return noticeTypeName;
    }


    public static String getNoticeTypeByType(String noticeType) {
        if (StringUtils.isEmpty(noticeType)) {
            return null;
        }
        for (NoticeTypeEnum e : NoticeTypeEnum.values()) {
            if (noticeType.equals(e.noticeType)) {
                return e.noticeTypeName;
            }
        }
        return null;
    }

    public static NoticeTypeEnum getByType(String noticeType) {
        if (StringUtils.isEmpty(noticeType)) {
            return null;
        }
        for (NoticeTypeEnum e : NoticeTypeEnum.values()) {
            if (noticeType.equals(e.noticeType)) {
                return e;
            }
        }
        return null;
    }
}
